package com.classic.okhttp.comparator;

import com.classic.okhttp.beans.HVVenueItemBean;

import java.util.Comparator;

/**
 * ltx on 2016/11/18 09:04
 * 场地的item详情 按开始时间来排序
 */
public class SortByStartTime implements Comparator{

    @Override
    public int compare(Object o1, Object o2) {
        HVVenueItemBean mHVVenueItemBean1 = (HVVenueItemBean) o1;
        HVVenueItemBean mHVVenueItemBean2 = (HVVenueItemBean) o2;
        int startTime1 = mHVVenueItemBean1.getItemStartTime();
        int startTime2 = mHVVenueItemBean2.getItemStartTime();
        if (startTime1 < startTime2) {
            return -1;
        }
        if (startTime1 > startTime2) {
            return 1;
        }
        return 0;
    }
}
